import request from '@/api/request'

/**获取商品评论 */
export const commentAgree = ({ id, agree }) =>
  request({
    url: `/api/comment/agree`,
    method: 'get',
    params: {
      id,
      agree,
    },
  })
/**获取评论详情 */
export const commentDetails = ({ id }) =>
  request({
    url: `/api/comment/details`,
    method: 'get',
    params: {
      id,
    },
  })
/**回复 */
export const commentReply = ({ main, reply }) =>
  request({
    url: `/api/comment/reply`,
    method: 'post',
    data: {
      main,
      reply,
    },
  })

/**评论 */
export const commentAdd = ({ id, main, image, evaluate }) =>
  request({
    url: `/api/comment/add`,
    method: 'post',
    data: {
      id,
      main,
      image,
      evaluate,
    },
  })
